<template>
    <div class="element_details">
        <div class="back">
            <Button type="primary" style="width: 5%;height: 30px" @click="back()">返回</Button>
        </div>
        <Form ref="form" :label-width="200">
            <Form-item :label="this.$t('unit_api.create_time')">
                <Input v-model="product.create_time"></Input>
            </Form-item>
            <Form-item :label="this.$t('unit_api.format')">
                <Input v-model="product.format"></Input>
            </Form-item>
            <Form-item :label="this.$t('unit_api.hash')">
                <Input v-model="product.hash"></Input>
            </Form-item>
            <Form-item :label="this.$t('unit_api.name')">
                <Input v-model="product.name"></Input>
            </Form-item>
            <Form-item :label="this.$t('unit_api.tags')">
                <Input v-model="product.tags"></Input>
            </Form-item>
            <Form-item :label="this.$t('unit_api.type')">
                <Input v-model="product.type"></Input>
            </Form-item>
            <Form-item :label="this.$t('unit_api.usable')">
                <Input v-model="product.usable"></Input>
            </Form-item>
            <Form-item :label="this.$t('unit_api.uv_mask')">
                <Input v-model="product.uv_mask"></Input>
            </Form-item>
        </Form>
    </div>
</template>

<script>
    import {component} from '../../http/API/index'
    export default {
        name: "element_details",
        data(){
          return{
              product:[]
            }
        },
        methods:{
            component(){
                console.log(this.$route.params.hash)
                component(this.$route.params.hash).then((res) => {
                    if(res.code = 20000){
                        this.product = res.data;
                        console.log(this.product);
                    }else{
                        console.log("提交错误");
                    }
                })
            },
            back(){
                this.$router.go(-1);
            }
        },
        mounted(){
            this.component();
        }
    }
</script>

<style scoped>

</style>